// src/stores/index.js
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'

const pinia = createPinia()
pinia.use(piniaPluginPersistedstate) // 注册插件

// 自动导入modules目录下的所有store
const modules = import.meta.glob('./modules/*.ts', { eager: true });

// 统一导出
export * from './modules/auth';
export * from './modules/cart';
export * from './modules/product';
export * from './modules/user';

export default pinia